<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>demo</title>
    <link rel="stylesheet" href="../../static/layui/css/layui.css">
</head>
<body>
<div class="layui-container" style="width: 90%;">
    <div class="layui-row">
        <div class="layui-col-md6" id="e1" style="height: 444px"></div>
        <div class="layui-col-md6" id="e2" style="height: 444px"></div>
    </div>
    <div class="layui-row">
        <div class="" id="e3" style="height: 444px"></div>
    </div>
    <div class="layui-row"></div>
</div>
</body>
<script type="text/javascript" src="../../static/layui/layui.all.js"></script>
<script type="text/javascript" src="../../static/config.js"></script>
<script type="text/javascript" src="../../static/echarts-5.0.2/echarts.js"></script>
<script type="text/javascript">
    const $ = layui.$;

    const p1 = {
        title: {
            text: "工单处理总览"
        },
        legend: {},
        tooltip: {},
        series: [
            {
                type: 'pie',
                data: []
            },
        ],
    }
    const p2 = {
        title: {
            text: "工单处理量月度总览"
        },
        legend: {
            show: false
        },
        tooltip: {},
        series: [
            {
                type: 'pie',
                data: []
            },
        ],
    }
    const p3 = {
        title: {
            text: "工单处理量年度总览"
        },
        legend: {
            show: false
        },
        xAxis: {
            type: "time"
        },
        yAxis: {},
        dataZoom: {
            type: "inside"
        },
        tooltip: {
            trigger: "axis"
        },
        dataset: {
            dimensions: ['name', 'value'],
            source: []
        },
        series: [
            {
                type: 'bar'
            },
        ],
    }
    $.get({
        url: baseUrl + "/hospital-doctor/doctor/getPie1",
        headers: {
            "x-token": localStorage.getItem("x-token")
        },
        success: function (res) {
            console.log(res);
            const e1 = echarts.init($("#e1")[0]);
            p1.series[0].data = res;
            e1.setOption(p1);
        }
    });
    $.get({
        url: baseUrl + "/hospital-doctor/doctor/getPie2",
        headers: {
            "x-token": localStorage.getItem("x-token")
        },
        success: function (res) {
            console.log(res);
            const e2 = echarts.init($("#e2")[0]);
            p2.series[0].data = res;
            e2.setOption(p2);
        }
    });
    $.get({
        url: baseUrl + "/hospital-doctor/doctor/getBar1",
        headers: {
            "x-token": localStorage.getItem("x-token")
        },
        success: function (res) {
            console.log(res);
            const e3 = echarts.init($("#e3")[0]);
            p3.dataset.source = res;
            e3.setOption(p3);
        }
    });

</script>
</html>